<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <link th:href="@{/erp/assets/css/bootstrap.min.css}" rel="stylesheet"/>
        <link rel="stylesheet" th:href="@{/erp/css/style.css}"/>
        <link rel="stylesheet" th:href="@{/erp/assets/css/ace.min.css}"/>
        <script th:src="@{/erp/assets/js/jquery.min.js}"></script>
        <script th:src="@{/erp/assets/layer/layer.js}" type="text/javascript"></script>
        <title>采购订单物流明细</title>
    </head>

    <body>
        <script>
            $(function () {
                $.ajax({
                    url: '/procurement/productType?id=' + $("#proId").text(),
                    type: "get",
                    dataType: "json",
                    success: function (data) {
                        if (data.type == "积分商品"){
                            $("#type").text(" 总积分： ")
                        }
                    }
                });
            })
        </script>
        <div class="margin clearfix">
            <div class="Order_Details_style">
                <div class="Numbering">采购订单编号:<b>[[${pOrder.orderId}]]</b></div>
            </div>
            <div class="detailed_style">
                <!--收件人信息-->
                <div class="Receiver_style">
                    <input type="hidden" id="pOrderId" th:value="${pOrder.id}"/>
                    <div class="Info_style clearfix">
                        <div class="col-xs-3">
                            <label class="label_name"> 收货地址： </label>
                            <div class="o_content" th:text="${pOrder.companyAddress}"></div>
                        </div>
                        <div class="col-xs-3">
                            <label class="label_name"> 买家名称： </label>
                            <div class="o_content" th:text="${pOrder.companyName}"></div>
                        </div>
                        <div class="col-xs-3">
                            <label class="label_name"> 物品名称： </label>
                            <div class="o_content" th:text="${pOrder.productName}"></div>
                        </div>
                        <div class="col-xs-3">
                            <label class="label_name"> 产品编号： </label>
                            <div class="o_content" id="proId" th:text="${pOrder.proId}"></div>
                        </div>

                        <div class="col-xs-3">
                            <label class="label_name"> 数量： </label>
                            <div class="o_content" th:text="${pOrder.sum}"></div>
                        </div>
                        <div class="col-xs-3">
                            <label class="label_name"> 商品类型： </label>
                            <div class="o_content" th:text="${pOrder.sortssName}"></div>
                        </div>
                        <div class="col-xs-3">
                            <label class="label_name"> 卖家名称： </label>
                            <div class="o_content" th:text="${pOrder.supplierName}"></div>
                        </div>
                        <div class="col-xs-3">
                            <label class="label_name"> 订单编号： </label>
                            <div class="o_content" th:text="${pOrder.orderId}"></div>
                        </div>
                        <div class="col-xs-3">
                            <label class="label_name"> 创建时间： </label>
                            <div class="o_content" th:text="${#dates.format(pOrder.orderTime,'yyyy-MM-dd HH:mm:ss')}" ></div>
                        </div>
                        <div class="col-xs-3">
                            <label class="label_name"> 成交时间： </label>
                            <div class="o_content" th:text="${#dates.format(pOrder.payTime,'yyyy-MM-dd HH:mm:ss')}"></div>
                        </div>
                        <div class="col-xs-3">
                            <label class="label_name" id="type"> 总价： </label>
                            <div class="o_content" th:text="${pOrder.money}"></div>
                        </div>
                        <div class="col-xs-3">
                            <label class="label_name"> 发件地址： </label>
                            <div class="o_content" th:text="${pOrder.supplierAddress}"></div>
                        </div>
                    </div>
                    <div class="title_name">物流信息</div>
                    <!--<div class="prompt"><img src="images/meiyou.png" /><p>暂无物流信息！</p></div>-->
                    <!--<div data-mohe-type="kuaidi_new" class="g-mohe " id="mohe-kuaidi_new">
                        <div id="mohe-kuaidi_new_nucom">
                            <div class="mohe-wrap mh-wrap">
                                <div class="mh-cont mh-list-wrap mh-unfold">
                                    <div class="mh-list">
                                        <ul>
                                            <li class="first">
                                                <p>2015-04-28 11:23:28</p>
                                                <p>妥投投递并签收，签收人：他人收 他人收</p>
                                                <span class="before"></span><span class="after"></span><i
                                                    class="mh-icon mh-icon-new"></i></li>
                                            <li>
                                                <p>2015-04-28 00:00:00</p>
                                                <p>离开中山市 发往深圳市（经转）</p>
                                                <span class="before"></span><span class="after"></span></li>
                                            <li>
                                                <p>2015-04-27 15:00:00</p>
                                                <p>到达广东省邮政速递物流有限公司中山三角邮件处理中心处理中心（经转）</p>
                                                <span class="before"></span><span class="after"></span></li>
                                            <li>
                                                <p>2015-04-27 08:46:00</p>
                                                <p>离开泉州市 发往中山市</p>
                                                <span class="before"></span><span class="after"></span></li>
                                            <li>
                                                <p>2015-04-26 17:12:00</p>
                                                <p>泉州市速递物流分公司南区电子商务业务部已收件，（揽投员姓名：王晨光;联系电话：<a href="tel:13774826403">13774826403</a>）
                                                </p>
                                                <span class="before"></span><span class="after"></span></li>
                                        </ul>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>-->
                </div>

            </div>
            <div class="Button_operation">
                <button onclick="member_fh()" class="btn btn-primary radius" type="button">确定签收</button>
                <button id="rtn"
                        class="btn btn-primary radius" type="button">返回
                </button>
            </div>
        </div>
    </body>
</html>
<!--发货图层-->
<div class="add_menber" id="add_menber_style" style="display:none">

    <ul class=" page-content">

        <li><label class="label_name" style="width:100px">订单编号：</label><span class="add_name" id="orderId">[[${pOrder.orderId}]]</span>
            <div class="prompt r_f"></div>
        </li>
        <br/>

        <div class="prompt r_f"></div>
        </li>
    </ul>
    <div class="Operate_cont clearfix">

        <script>
            /*发货*/
            function member_fh(id) {
                layer.open({
                    type: 1,
                    title: '确认收货',
                    maxmin: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['800px', ''],
                    content: $('#add_menber_style'),
                    btn: ['确认', '取消'],
                    yes: function (index, layero) {

                        $.ajax({
                            url: '[[@{/procurement/take}]]',
                            data: {orderId:$("#orderId").text()},
                            contentType: 'application/json',           //表示我们发送给服务器数据是json格式
                            dataType: 'json',                          //表示服务器返回给我们的数据是json格式
                            success: function (data) {
                                if (data.result == true) {
                                    // 提交成功后的回调
                                    layer.msg('收货成功！', {icon: 1, time: 1000}, function () {
                                        var index = parent.layer.getFrameIndex(window.name);
                                        var index1 = parent.parent.layer.getFrameIndex(window.name);
                                        parent.layer.close(index);
                                        parent.parent.layer.close(index1);
                                    });
                                } else {
                                    layer.msg('收货失败！', {icon: 2,});
                                }
                            },
                            error: function (data) {
                                layer.alert("收货失败：" + data.data);
                            }
                        })

                        return false;
                    }
                });
            }

            $("#rtn").on("click",function () {
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            })

        </script>
    </div>
</div>